package convert;


import entity.Point;
import org.apache.struts2.util.StrutsTypeConverter;

import java.util.Map;

public class PointConvert extends StrutsTypeConverter {
    @Override
    public Object convertFromString(Map map, String[] strings, Class aClass) {
        String [] str=strings[0].split(",");
        int x= Integer.parseInt(str[0]);
        int y= Integer.parseInt(str[1]);
        Point point=new Point();
        point.setX(x);
        point.setY(y);
        return point;
    }

    @Override
    public String convertToString(Map map, Object o) {
        return null;
    }
}
